package com.etone.smartAudit.enums;

import lombok.Getter;

/**
 * @author 张任豪
 */
public enum WorkRectifyType {

    NOT_RECTIFY(0, "未整改"),
    PART_RECTIFY(1, "部分整改"),
    ALL_RECTIFY(2, "完全整改");
    @Getter
    public Integer value;
    @Getter
    public String remark;

    WorkRectifyType(Integer value, String remark) {
        this.value = value;
        this.remark = remark;
    }


    public static WorkRectifyType getInstance(Integer value){
        if (value == null){
            return null;
        }
        WorkRectifyType[] values = WorkRectifyType.values();
        for (WorkRectifyType workRectifyType : values) {
            if (workRectifyType.value.equals(value)){
                return workRectifyType;
            }
        }
        return null;
    }

    public static String getRemark(Integer value) {
        if (value == null) {
            return null;
        }
        WorkRectifyType[] values = WorkRectifyType.values();
        for (WorkRectifyType workRectifyType : values) {
            if (workRectifyType.getValue().equals(value)) {
                return workRectifyType.getRemark();
            }
        }
        return null;
    }
}
